<template>
    <div class="box">
        <ul class="zjss clear" v-if="searchdata.length != 0">
            <li class="i1">
                <h1>最近搜索</h1>
                <van-icon name="delete-o" />
            </li>
            <li class="i2">
                <p v-for="(val,index) in searchdata" :key="index">
                    {{val}}
                </p>
            </li>
        </ul>

        <ul class="ssfx">
            <li class="i1">
                <h1>搜索发现</h1>
            </li>
            <li class="i2">
                <p>荣耀20Pro</p>
                <p>华为nova6</p>
                <p>{{this.$store.state.searchVal}}</p>
            </li>
        </ul>

        <ul class="rmtj">
            <li class="i1">
                <h1>最近搜索</h1>
            </li>
            <ul class="u1">
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
            </ul>

            <ul class="u2">
                <li v-for="(data,index) in 4" :key="index">
                    <img src="../../assets/imgs/PrdShow_1643426577356.webp" alt="">
                    <p>荣耀60Pro</p>
                </li>
            </ul>
        </ul>
    </div>
</template>

<script>
export default {
  data () {
    return {
      searchdata: []
    }
  },
  mounted () {
    this.searchdata = JSON.parse(localStorage.getItem('searchData')).arr
  }
}
</script>

<style scoped>
.box{
    margin-top: 3.5rem;
}
.zjss{
    width: 23.4375rem;
}
.zjss li:nth-child(1){
    width: 100%;
    height: 30px;
}
.zjss h1{
    line-height: 30px;
    float: left;
    font-size: 17px;
    margin-left: 10px;
    color: black;
}
.zjss i{
    line-height: 30px;
    float: right;
    font-size: 20px;
    margin-right: 0.75rem;
}

.zjss .i2 p{
    line-height: 1.25rem;
    text-align: center;
    float: left;
    background-color: #f2f2f2;
    margin: 10px 5px 10px 5px;
    padding: 5px;
    border-radius: 10px;
    color: black;

}
.ssfx {
    width: 100%;
    float: left;
    margin: 20px auto;
}
.ssfx .i1{
    width: 100%;
    height: 30px;
    background-color: white;
}
.ssfx h1{
    line-height: 30px;
    float: left;
    font-size: 17px;
    margin-left: 10px;
    color: black;
}
.ssfx .i2 p{
     line-height: 1.25rem;
    text-align: center;
    float: left;
    background-color: #f2f2f2;
    margin: 10px 5px 10px 5px;
    padding: 5px;
    border-radius: 10px;
    color: black;

}
.rmtj .u1{
    width: 15%;
    text-align: center;
    float: left;
}
.rmtj .u2{
    width: 85%;
    float: left;
}
.rmtj .u1 li{
    width: 100%;
    line-height: 3rem;
    margin: 10px auto;
    font-size: 17px;
    font-weight: bold;
}
.rmtj .u1 li:nth-child(1){
    color: #febd00;

}
.rmtj .u1 li:nth-child(2){
    color: #fe9600;

}
.rmtj .u1 li:nth-child(3){
    color: #a36200;

}
.rmtj .u1 li:nth-child(4){
    color: #aaaaaa;
}
.rmtj h1{
    line-height: 30px;
    font-size: 17px;
    margin-left: 10px;
    color: black;
}

.rmtj .u2 li{
    width: 100%;
    height: 3rem;
    margin: 10px auto;
    font-size: 17px;
    font-weight: bold;
}
.rmtj .u2 li img{
    height: 100%;
    float: left;
}
.rmtj .u2 p{
    float: left;
    line-height: 3rem;
    margin-left: 5px;
    color: #343434;
}

</style>
